****** The Dark Side of Community Ties. Collective Action and Lynching in Mexico ***********************
****** Author: Enzo Nussio
****** Date of replication material: 1 April 2024
****** Publication: American Sociological Review
******************************************************************************

*** Analysis based on STATA 16

******************************************************************************

****** ANALYSIS IN MAIN ARTICLE **********************************************

*********************INDIVIDUAL ANALYSIS***************************************
*** GET DATA
clear
use "Mexico City Individual data.dta"
*check data directory

*** TABLE 2
set scheme s2mono
eststo clear
eststo: qui reg PARP lognombre IT1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust" _cons "Constant") replace

*** FIGURE 3
reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
margins, at(lognombre=(0(1)7))
marginsplot, scheme(s2mono) xtitle("Names known in colonia (log)") ytitle("Predicted probability of participation") title ("") plotregion(margin(l+4 r+4)) plotopts(mcolor(black) ms(diamond)) recast(scatter) name(se, replace)

*********************MECHANISMS***************************************
*** TABLE 3
set scheme s2mono
eststo clear
eststo: qui reg EMO1 lognombre IT1 ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg EMO1 lognombre IT1  ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
eststo: qui reg PEER lognombre IT1  ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PEER lognombre IT1 ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("United with neighbors" "United with neighbors" "Neighbors encourage lynching" "Neighbors encourage lynching") varlabels(lognombre "Names known (log)" IT1 "Trust" _cons "Constant") replace


*********************AGGREGATE ANALYSIS***************************************
*** GET DATA
clear
use "Mexico Municipality Cross-Sectional Data.dta"
*check data directory

*** TABLE 4*********
eststo clear
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Linear regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace


*********************NATURAL EXPERIMENT***************************************
*** GET DATA
clear
use "Mexico Municipality Panel Data.dta"
*check data directory

*** TABLE 5*********
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace



*******************Analysis in Appendix****************************************

*********************INDIVIDUAL ANALYSIS***************************************
*** GET DATA
clear
use "Mexico City Individual data.dta"
*check data directory

*** 4.1 FULL TABLE
set scheme s2mono
eststo clear
eststo: qui reg PARP lognombre IT1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed working catholic nonreligious  PELEA  PADRES index_trustgov BASURA RESS , cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed working catholic nonreligious PELEA  PADRES index_trustgov BASURA RESS  i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(*.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)" IT1 "Trust" ED "Education" age "Age" female "Female" INGi "Number of light bulbs" unemployed "Unemployed" working "Working" catholic "Catholic" nonreligious "Non-religious" PELEA "Participated in fight" PADRES "Parents live in colonia" index_trustgov "Trust in government" BASURA "Garbage on the street" RESS "Residential street block" _cons "Constant") replace

*** 4.2 Community participation
eststo clear
eststo: qui reg PARP community, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP community ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP community ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP community ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(community "Community participation" _cons "Constant") replace


*** 4.3 Logit modeling
eststo clear
eststo: qui logit PARP lognombre IT1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui logit PARP lognombre IT1 ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui logit PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui logit PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust" _cons "Constant") replace

*** 4.4 Removing outliers
eststo clear
eststo: qui reg PARP lognombre IT1 if Nombre<201, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed if Nombre<201, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov if Nombre<201, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col if Nombre<201, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust" _cons "Constant") replace

*** 4.5 Adjusting for witnessing a lynching
eststo clear
eststo: qui reg PARP lognombre IT1 OBSP, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 OBSP ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 OBSP ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 OBSP ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust"  OBSP "Witnessed a lynching" _cons "Constant") replace

*** 4.6 Subsetting sample to only people who witnessed a lynching (N=498)
eststo clear
eststo: qui reg PARP lognombre IT1 if OBSP==1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed  if OBSP==1, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov  if OBSP==1, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col  if OBSP==1, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust"  _cons "Constant") replace

*** 4.7 Adjusting for agreeing with lynching
eststo clear
eststo: qui reg PARP lognombre CNDH34 IT1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre CNDH34 IT1 ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre CNDH34 IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre CNDH34 IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust" CNDH34 "Agrees with lynching" _cons "Constant") replace

*** 4.8 Adjusting for previous lynching in colonia
eststo clear
eststo: qui reg PARP lognombre IT1 lynch_event, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed lynch_event, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov lynch_event, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP lognombre IT1 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov lynch_event i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(lognombre "Names known (log)"  IT1 "Trust" _cons "Constant") replace

***4.9 Parents' siblings as proxy for strong ties
eststo clear
eststo: qui reg PARP siblings12 IT1, cl(cve_col)
estadd local FE "No"
estadd local Controls "No"
eststo: qui reg PARP siblings12 ED age female INGi unemployed, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PARP siblings12 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA  PADRES index_trustgov, cl(cve_col)
estadd local FE "No"
estadd local Controls "All"
eststo: qui reg PARP siblings12 ED age female INGi unemployed HER catholic nonreligious working BASURA RESS PELEA PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("" "" "" "") varlabels(siblings12 "Parents' siblings in dozens" _cons "Constant") replace


*********************MECHANISMS***************************************
*** 4.10 Full table
eststo clear
eststo: qui reg EMO1 lognombre IT1 ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg EMO1 lognombre IT1  ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
eststo: qui reg PEER lognombre IT1  ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg PEER lognombre IT1 ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(*.col) scalars("FE Colonia FE" "Controls Control variables") ml("United with neighbors" "United with neighbors" "Neighbors encourage lynching" "Neighbors encourage lynching" "Would call police on perpetrators" "Would call police on perpetrators") varlabels(lognombre "Names known (log)" IT1 "Trust" ED "Education" HER "Own siblings" age "Age" female "Female" INGi "Number of light bulbs" unemployed "Unemployed" working "Working" catholic "Catholic" nonreligious "Non-religious" PELEA "Participated in fight" PADRES "Parents live in colonia" index_trustgov "Trust in government" BASURA "Garbage on the street" RESS "Residential street block" _cons "Constant") replace

*** A4.11 Alternative mechanisms
eststo clear
eststo: qui reg AME2 lognombre IT1 ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg AME2 lognombre IT1  ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
eststo: qui reg index_trustgov lognombre IT1  ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg index_trustgov lognombre IT1 ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
eststo: qui reg index_binding lognombre IT1 ED age female INGi, cl(cve_col)
estadd local FE "No"
estadd local Controls "Some"
eststo: qui reg index_binding lognombre IT1 ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov i.col, cl(cve_col)
estadd local FE "Yes"
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) addnote("OLS regression, standard errors clustered at Colonia level (340 clusters)." "Varying N due to non-response.") drop(ED age female INGi HER catholic nonreligious working unemployed BASURA RESS PELEA  PADRES index_trustgov *.col) scalars("FE Colonia FE" "Controls Control variables") ml("Threatened by delinquency" "Threatened by delinquency" "Trust in government" "Trust in government" "Binding values" "Binding values") varlabels(lognombre "Names known (log)" IT1 "Trust" _cons "Constant") replace


*********************AGGREGATE ANALYSIS***************************************
*** GET DATA
clear
use "Mexico Municipality Cross-Sectional Data.dta"
*check data directory

*** A4.12 Full table
eststo clear
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(*.estado) scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" problem_lighting_mean "Problem with lighting" c_poptot "Population" area "Area in km2" dist_mex_city "Distance to Mexico City" pconeval_poverty_pobreza_pob "Poverty rate" coneval_gini_coeficientedegini "Gini coefficient" indigenous "Share indigenous people" c_poptot_norelpop "Non-religious population" homirate "Homicide rate" robberyrate "Robbery rate" victim_household_before_prev_yea "Household victimization" trust_army_mean "Trust in army" _cons "Constant") replace

*** A4.13 Homicide rate
eststo clear
eststo: qui reg loghomirate organized_lighting_mean trust_neighbors_mean problem_lighting_mean,cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loghomirate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop   ,cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loghomirate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop    victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loghomirate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop    victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  victim_household_before_prev_yea trust_army_mean *.estado) scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" problem_lighting_mean "Problem with lighting" c_poptot "Population" area "Area in km2" dist_mex_city "Distance to Mexico City" pconeval_poverty_pobreza_pob "Poverty rate" coneval_gini_coeficientedegini "Gini coefficient" indigenous "Share indigenous people" c_poptot_norelpop "Non-religious population" homirate "Homicide rate" robberyrate "Robbery rate" victim_household_before_prev_yea "Household victimization" trust_neighbors_mean "Generalized trust" trust_army_mean "Trust in army" _cons "Constant") replace

*** A4.14 Robbery rate 
eststo clear
eststo: qui reg logrobberyrate organized_lighting_mean trust_neighbors_mean problem_lighting_mean,cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg logrobberyrate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop   ,cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg logrobberyrate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop    victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg logrobberyrate organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop    victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  victim_household_before_prev_yea trust_army_mean *.estado) scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" problem_lighting_mean "Problem with lighting" c_poptot "Population" area "Area in km2" dist_mex_city "Distance to Mexico City" pconeval_poverty_pobreza_pob "Poverty rate" coneval_gini_coeficientedegini "Gini coefficient" indigenous "Share indigenous people" c_poptot_norelpop "Non-religious population" homirate "Homicide rate" robberyrate "Robbery rate" victim_household_before_prev_yea "Household victimization" trust_neighbors_mean "Generalized trust" trust_army_mean "Trust in army" _cons "Constant") replace

*** A4.15 Principal component
eststo clear
eststo: qui reg loglynchpermio organized_component problem_component trust_neighbors_mean , cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_component problem_component  trust_neighbors_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_component problem_component  trust_neighbors_mean  c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_component problem_component  trust_neighbors_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop( c_poptot area problem_component  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_component "Neighborly cooperation (principal component)" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.16 Poisson analysis without logging DV
eststo clear
eststo: qui poisson lynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui poisson lynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui poisson lynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui poisson lynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Poisson regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.17 Only lynchings resulting in death or injury
eststo clear
eststo: qui reg logfatalorinjurypermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg logfatalorinjurypermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg logfatalorinjurypermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg logfatalorinjurypermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.18 Only fatal lynchings as dependent variable
eststo clear
eststo: qui reg logfatalpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg logfatalpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg logfatalpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg logfatalpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Linear regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.19 Only municipalities with at least 50 ENVIPE survey observations for each municipality
eststo clear
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean if organized_lighting_obs>49, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate if organized_lighting_obs>49, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean if organized_lighting_obs>49,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado if organized_lighting_obs>49
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Linear regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.20 Only municipalities with at least 100 ENVIPE survey observations for each municipality
eststo clear
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean if organized_lighting_obs>99, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate if organized_lighting_obs>99, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean if organized_lighting_obs>99,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado if organized_lighting_obs>99
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Linear regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace

*** A4.21 Only municipalities with at least 300 ENVIPE survey observations for each municipality
eststo clear
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean if organized_lighting_obs>299, cl(estado)
estadd local FE "No"
estadd local Controls "No"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate if organized_lighting_obs>299, cl(estado)
estadd local FE "No"
estadd local Controls "Some"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean if organized_lighting_obs>299,cl(estado)
estadd local FE "No"
estadd local Controls "All"
estadd local Cluster "Yes"
eststo: qui reg loglynchpermio organized_lighting_mean trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean  i.estado if organized_lighting_obs>299
estadd local FE "Yes"
estadd local Controls "All"
estadd local Cluster "No"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean *.estado) addnote("Linear regression with cross-sectional municipality data and different specifications.") scalars("Controls Control variables" "FE Estado FE" "Cluster Estado Clustered SE") ml("" "" "" "") varlabels(organized_lighting_mean "Neighborly cooperation" trust_neighbors_mean "Trust" _cons "Constant") replace


*********************NATURAL EXPERIMENT***************************************
*** GET DATA
clear
use "Mexico Municipality Panel Data.dta"
*check data directory

*** 4.22 Full table
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" secuestrofull "Kidnappings" _cons "Constant") ml("" "" "" "" "" "") replace

*** 4.23 Reporting bias
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg n_doc_tot `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg n_doc_tot `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.24 Adjusting for newspaper reporting
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var' n_doc_tot i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var' n_doc_tot  homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" n_doc_tot "Number of news reports" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.25 Lagged DV
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var' laglynch_event i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var'  laglynch_event homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" laglynch_event "Lagged DV" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.26 Dropping 2017
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var'  i.year if year<2021 & year!=2017, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year  if year<2021 & year!=2017, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.27 Only 2016-2018
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg lynch_event `var'  i.year if year<2019 & year>2015, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg lynch_event `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year  if year<2019 & year>2015, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.28 Only including fatal lynchings as dependent variable
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg tar_outcome_fatal `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg tar_outcome_fatal `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.29 Poisson analysis
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtpoisson lynch_event `var'  i.year if year<2021, fe robust
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtpoisson lynch_event `var'   homicidefull robofull secuestrofull inegi_infant_mort  i.year, fe robust
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and robust standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.30 Non-equivalent outcome: homicides 
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg homicidefull `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg  homicidefull `var'    robofull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort  robofull secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.31 Non-equivalent outcome: robberies 
estimates clear
xtset cve year
local m=1
foreach var of varlist eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017 {
eststo model_`m': qui xtreg robofull `var'  i.year if year<2021, fe vce(cluster cve)
local m `++m'
estadd local Controls "No"
eststo model_`m': qui xtreg  robofull `var'    homicidefull secuestrofull inegi_infant_mort  i.year, fe vce(cluster cve)
local m `++m'
estadd local Controls "Yes"
}
esttab model_* using myfile.rtf, scalars("Controls Control variables") se ar2(2) nogap onecell varwidth(7) modelwidth(7) b(2) star(* 0.05 ** 0.01 *** 0.001) order(eq2017_250X2017 eq2017_damageX2017 eq2017_dist100X2017) addnote("Linear regression with year and municipality fixed effects, and municipality clustered standard errors.") varlabels(eq2017_250X2017 "Within 250km from earthquake X After 2017" eq2017_damageX2017 "Earthquake damage X After 2017" eq2017_dist100X2017 "Distance from Earthquake in 100km X After 2017" inegi_infant_mort "Infant mortality" homicidefull "Homicides" robofull "Robberies" _cons "Constant") drop(inegi_infant_mort homicidefull  secuestrofull *year) ml("" "" "" "" "" "") replace

*** 4.32 Volcano exposure
*** GET DATA
clear
use "Mexico Municipality Cross-Sectional Data.dta"
*check data directory

eststo clear
eststo: qui reg organized_lighting_mean dist_volc_active_100km trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local Controls "No"
eststo: qui reg loglynchpermio dist_volc_active_100km trust_neighbors_mean problem_lighting_mean, cl(estado)
estadd local Controls "No"
eststo: qui reg organized_lighting_mean dist_volc_active_100km trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local Controls "Some"
eststo: qui reg loglynchpermio dist_volc_active_100km trust_neighbors_mean problem_lighting_mean c_poptot area  pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate, cl(estado)
estadd local Controls "Some"
eststo: qui reg organized_lighting_mean dist_volc_active_100km trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local Controls "All"
eststo: qui reg loglynchpermio dist_volc_active_100km trust_neighbors_mean problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean,cl(estado)
estadd local Controls "All"
esttab using myfile.rtf, b(2) se ar2(2) nogap onecell varwidth(7) modelwidth(7) star(* 0.05 ** 0.01 *** 0.001) drop(problem_lighting_mean c_poptot area   pconeval_poverty_pobreza_pob coneval_gini_coeficientedegini indigenous c_poptot_norelpop  homirate robberyrate victim_household_before_prev_yea trust_army_mean) addnote("Linear regression with Estado clustered standard errors.") scalars("Controls Control variables")  ml("Neighborly cooperation" "Lynching rate (log)" "Neighborly cooperation" "Lynching rate (log)" "Neighborly cooperation" "Lynching rate (log)") varlabels(organized_lighting_mean "Neighborly cooperation" dist_volc_active_100km "Distance to active volcano" trust_neighbors_mean "Trust" _cons "Constant") replace